<?php
class Pageley_Gateway_Database_Condition_InSqlDecorator extends Pageley_Gateway_Database_Condition_SingleSqlDecorator {
     
    public function __construct($decoratedCondition, $query) {
        parent::__construct($decoratedCondition, $query);
    }
    
    public function getKeyExpression() {
        $keyExpression = null;
        foreach($this->getDecoratedCondition()->getKeys() as $key) {
            if($keyExpression === null) {
                $keyExpression .= "(";
            } else {
                $keyExpression .= ", ";
            }
            $sqlKey = Pageley_Util_String::addUnderscores(Pageley_Util_String::replace($key, ".", "_"));
            $keyExpression .= ":" . Pageley_Util_String::addUnderscores($sqlKey);
        }
        return $keyExpression . ")";
    }
}